{extend name="base:frame" /}
{block name="main"}
        <label class="layui-form-label">选择状态</label>
        <select name="status" id="status" style="width:100px; height:37px;" onchange="setstatus()">

            <option value="" selected="selected">全部</option>
            <option value="0">待付款</option>
            <option value="1">待发货</option>
            <option value="2">待收货</option>
            <option value="3">已完成</option>
            <option value="4">已退款</option>

        </select>
<table class="layui-table">
    <thead>
    <tr>
        <th>订单编号</th>
        <th>订单总额</th>
        <th>下单时间</th>
        <th>订单状态</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    {volist name='list' id='item'}
    <tr>
        <td>{$item.orderno}</td>
        <td>{$item.totalprice}</td>
        <td>{$item.datetime}</td>
        <td>
            {switch name="$item.status" }
            {case value="0"}待付款{/case}
            {case value="1"}待发货{/case}
            {case value="2"}待收货{/case}
            {case value="3"}已完成{/case}
            {case value="4"}已退款{/case}
            {/switch}
        </td>
        <td>
            <a href="/admin/order/detail?orderno={$item.orderno}">订单详情</a>
        </td>
    </tr>
    {/volist}

    </tbody>
</table>
<script>
    var status = $_GET['status']
    $(function () {
        $("#status").val(status)
    })

    function setstatus() {
        window.location.href='/admin/order/lists?status='+$("#status").val()
    }
</script>
{$list->render()}
{/block}